$def with (id,child_id,dpi)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Golden Forest File Printer</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Bootstrap -->
    <link href="static/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="static/css/print-style.css" rel="stylesheet">
    <link href="static/css/jquery.shCircleLoader.css" rel="stylesheet">

    <script src="static/jquery/jquery-1.7.1.min.js"></script>
    <script src="static/bootstrap/js/bootstrap.min.js"></script>
    <script src="static/jquery/jquery.shCircleLoader-min.js"></script>

    <script src="static/jquery/jquery-ui-1.8.17.custom.min.js"></script>
    <script src="static/jquery/jquery.jqprint-0.3.js"></script>

    <script src="static/Filesaver/FileSaver.min.js"></script>
    <script src="static/html2canvas/sameMaze.js"></script>
    <script src="static/html2canvas/canvas2image.js"></script>
    <script src="static/jsPDF/jspdf.js"></script>

    <script src="static/jsPDF/plugins/addimage.js"></script>
    <script src="static/jsPDF/plugins/png_support.js"></script>
    <script src="static/jsPDF/libs/png_support/png.js"></script>
    <script src="static/jsPDF/libs/png_support/zlib.js"></script>
    <script src="static/jsPDF/plugins/png_support.js"></script>
    <script src="static/jsPDF/plugins/addhtml.js"></script>
    <script src="static/jsPDF/plugins/from_html.js"></script>

    <!-- See closing body for JS -->
    <script>
        var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
        var dest_H3 = document.getElementById("please_wait");

        function dealData_detail(schedule_content) {
            var base_info = schedule_content.base_info;
            var html_list = schedule_content.html_list;
            if((base_info == null) || (html_list.length ==0)){
                return 0;
            }
            try{
                drawContent(base_info,html_list);
            }catch (e){
                alert(e);
                return 0;
            }
            return 1;
        };

        function dealData(schedule_data){
            var data_error = 1;
            var json_data = schedule_data.schedule_data;
            for (var x = 0; x < json_data.length; x++) {
                current_child_id= json_data[x].id;
                current_position = 0;
                page_count = 0;
                data_error = dealData_detail(json_data[x]);
            };
            if(data_error == 1){
                changeH3();
            }
            else{
                dest_H3.textContent = "生成失败，无数据....";
                $$("#shclDefault").css("display","none");
                alert("生成失败");
            }
        };


        function getDataByID(schedule_id,child_id) {
            $$("#please_wait").css("display","inherit");
            $$("#shclDefault").css("display","inherit");
            dest_H3 = document.getElementById("please_wait");
            dest_H3.textContent = "正在获取题目，请稍后...";
            $$('#shclDefault').shCircleLoader({
                duration:2.25,
                dotsRadius:2,
                dots:25
            });
            data_url = "/getdata?schedule_id=" + schedule_id.toString()+"&child_id="+child_id.toString();
            $$.ajax({
                type: "get",
                url: data_url,
                dataType: "json",
                success: function (data) {
                    dest_H3.textContent = "题目数据获取成功，页面渲染中....";
                    dealData(data);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    dest_H3.textContent = "数据获取失败，失败原因：" + errorThrown;
                    $$("#shclDefault").css("display","none");
                    alert(errorThrown);
                }
            });
        };

    function doPrint(){
        $$("#pages").jqprint();
    };


    function doGeneratePDF(divID, filename){
        //var pdfHeight = tm.height;
        var doc = new jsPDF('p','mm','a4');
        var dest_div = document.getElementById(divID);
        var childs = dest_div.childNodes;
        for(var i = 0; i <=childs.length - 1; i++) {
            if(dest_div.children[i] == null){
                continue;
            }
            else{
                var imageToAddatPdf = dest_div.children[i].src;
                doc.addImage(imageToAddatPdf, 'PNG', 0, 0,210,297);
                if(i <childs.length - 2){
                    doc.addPage();
                }
            }
        }
        doc.save(filename + '.pdf');
    }

    $$(document).ready(function(){
        if((userAgent.indexOf("Chrome") == -1) && (userAgent.indexOf("Firefox") == -1)&& (userAgent.indexOf("Mozilla") == -1)&& (userAgent.indexOf("iPad") == -1)){
            dest_H3 = document.getElementById("please_wait");
            dest_H3.textContent = "请使用Chrome或Firefox浏览器！" ;
            alert(userAgent);
            alert("请使用Chrome或Firefox浏览器！");
        }
        else{
            global_print_dpi = $:dpi;
            getDataByID($:id,$:child_id);
            if((userAgent.indexOf("Mozilla") >0)|| (userAgent.indexOf("iPad") > 0)) {
                font_family = "Arial";//"Microsoft YaHei";//字体，请使用英文名
            }
        }
    });

    </script>
</head>
<body>

<input id="isPrint" type="hidden" value="true">
<br>&nbsp&nbsp&nbsp
<a href="#" onclick="doPrint();" class="download-button pdf btn text--white bg-px--green soft-two--sides btn__border--bottom-green text--bold text--medium">
    打印预览
</a>&nbsp&nbsp&nbsp&nbsp
<!--
<a href="#" onclick="doGeneratePDF('pages','金色雨林备课系统教案');" class="download-button pdf btn text--white bg-px--green soft-two--sides btn__border--bottom-green text--bold text--medium">
    下载PDF
</a>&nbsp&nbsp&nbsp&nbsp
-->
<h3 id="please_wait">正在获取题目，请稍后...</h3>
<div id="shclDefault"></div>


<div id="pages" style="text-align: center;">

</div>
<div style="text-align: center;display: none;">
    <img id="imgTopicContent" style="background: #ffffff; margin-top: 10px;">
</div>
<div style="border: 1px;border-color: #0e90d2">
    <canvas id="canvas" width="210" height="297" style="border: 5px ;border-color: #0e90d2;display:none;">
        Canvas not supported
    </canvas>
</div>


<img id ="hiddenImage" stlye='display:none' onload='this.style.display="block" '  />

    <script type="text/javascript" src="/getresource?id=$:id&child_id=$:child_id&resource.js"></script>

    <script type="text/javascript" src="/static/visual/decoding1.js"></script>
    <script type="text/javascript" src="/static/visual/schulte_grid.js"></script>
    <script type="text/javascript" src="/static/visual/sign.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_digital.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_english.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_images.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_sum10.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_letter.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_chinese.js"></script>
    <script type="text/javascript" src="/static/visual/cancellation_chinese_twins.js"></script>

    <script type="text/javascript" src="/static/js/config_global.js"></script>
    <script type="text/javascript" src="/static/visual/public.js"></script>
    <script type="text/javascript" src="/static/visual/goldenforest.js"></script>
</body>

</html>